package com.dyna.foundation.domain.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.apache.ibatis.type.JdbcType;

import java.time.LocalDateTime;

/**
 * 租户 DO
 *
 * @author 芋道源码
 */
@TableName(value = "system_tenant", autoResultMap = true)
@Data
@Builder
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class SysTenant {

    @ApiModelProperty(value = "套餐编号 - 系统")
    public static final Long PACKAGE_ID_SYSTEM = 0L;

    @ApiModelProperty(value = "租户编号，自增")
    private Long id;

    @ApiModelProperty(value = "租户名，唯一")
    private String name;

    @ApiModelProperty(value = "联系人的用户编号")
    private Long contactUserId;

    @ApiModelProperty(value = "联系人")
    private String contactName;

    @ApiModelProperty(value = "联系手机")
    private String contactMobile;

    @ApiModelProperty(value = "租户状态")
    private Integer status;

    @ApiModelProperty(value = "绑定域名")
    private String website;

    @ApiModelProperty(value = "租户套餐编号")
    private Long packageId;

    @ApiModelProperty(value = "过期时间")
    private LocalDateTime expireTime;

    @ApiModelProperty(value = "账号数量")
    private Integer accountCount;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "最后更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "创建者，目前使用 SysUser 的 id 编号")
    @TableField(fill = FieldFill.INSERT, jdbcType = JdbcType.VARCHAR)
    private String creator;

    @ApiModelProperty(value = "更新者，目前使用 SysUser 的 id 编号")
    @TableField(fill = FieldFill.INSERT_UPDATE, jdbcType = JdbcType.VARCHAR)
    private String updater;

}